package com.nthink.indicators.service.qualitymanagement.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nthink.indicators.mapper.qualitymanagement.SafeManagementMapper;
import com.nthink.indicators.pojo.qualitymanagement.SafeManagement;
import com.nthink.indicators.service.qualitymanagement.SafeManagementService;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class SafeManagementServiceImpl extends ServiceImpl<SafeManagementMapper, SafeManagement> implements SafeManagementService {

    @Override
    public SafeManagement getSafeManagement(Date startTime, Date endTime) {
        SafeManagement safeManagement = new SafeManagement();

        safeManagement.setAirwayProlapse(baseMapper.getAirwayProlapse(startTime, endTime));
        safeManagement.setInRegAgainRate(baseMapper.getInRegAgainRate(startTime, endTime));
        safeManagement.setInMonthRegAgainRate(baseMapper.getInMonthRegAgainRate(startTime, endTime));
        safeManagement.setPressureSores(baseMapper.getPressureSores(startTime, endTime));
        safeManagement.setFall(baseMapper.getFall(startTime, endTime));
        safeManagement.setOperationCount(baseMapper.getOperationCount(startTime, endTime));
        safeManagement.setTotalCount(baseMapper.getTotalCount(startTime, endTime));

        return safeManagement;
    }
}
